Skip to content

Conversation

@cjllanwarne
Copy link
Collaborator

@cjllanwarne cjllanwarne commented Oct 22, 2025

Change Description

Fixes our bootstrap_create_accounts script to be resilient to inactive users.

In this case "create"ing an account that is currently inactive becomes reactivating it.

Security Assessment

  • This change potentially impacts the Hail Batch instance as deployed by Broad Institute in GCP

Impact Rating

  • This change has a low security impact

Impact Description

Making a script resilient be replacing a "create" action with a "reactivate" action, if necessary

Appsec Review

  • Required: The impact has been assessed and approved by appsec

@cjllanwarne cjllanwarne requested a review from a team as a code owner October 22, 2025 19:22
@cjllanwarne cjllanwarne requested a review from grohli October 22, 2025 19:22
Copy link
Contributor

@grohli grohli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one comment/question I had on the new change see updated comment. In that case LGTM! Thanks for the fix.

'UPDATE users SET state = "active", last_activated = CURRENT_TIMESTAMP(3) WHERE id = %s;',
(row['id'],),
)
return None
Copy link
Contributor

@grohli grohli Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to confirm, will this reactivate all inactive users rather than just any inactive test users (eg test-dev)? And then follow up if yes, do we think making every inactive user active again mess with anything else downstream of this in ci?

Disregard, I can't read. I see now that we're only doing this for the bot accounts:

users = [
# username, login_id, is_developer, is_service_account
('auth', None, 0, 1),
('batch', None, 0, 1),
('ci', None, 0, 1),
('test', None, 0, 0),
('test-dev', None, 1, 0),
('grafana', None, 0, 1),
]

...
for username, login_id, is_developer, is_service_account in users:
user_id = await insert_user_if_not_exists(app, username, login_id, is_developer, is_service_account)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but actually bot or non-bot we can read this as "for the accounts that we are bootstrapping into the system, we should reactivate them if they already exist but are inactive". It doesn't do anything to any other preexisting accounts

Copy link

@sarahgibs sarahgibs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.

@hail-ci-robot hail-ci-robot merged commit d50d178 into hail-is:main Nov 4, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants